<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/loginTemplate.xhtml">
	<ui:define name="body">
		<h:form id="loginForm" styleClass="form-signin">
			<h2 class="form-signin-heading">#{messages['login.form.title']}</h2>
			
			<div id="emailValidationContainer">
				<h:message styleClass="text-error" for="email" />
			</div>
			<h:inputText id="email" value="#{loginBackingBean.username}" styleClass="input-block-level" requiredMessage="#{messages['login.form.empty.input.error']}">
				<f:validateRequired />
			</h:inputText>
			<p:watermark id="emailWatermark" for="email" value="#{messages['login.form.email']}" />
			
			<div id="passwordValidationContainer">
				<h:message styleClass="text-error" for="password" />
			</div>
			<h:inputSecret id="password" value="#{loginBackingBean.password}" styleClass="input-block-level" requiredMessage="#{messages['login.form.empty.input.error']}">
				<f:validateRequired />
			</h:inputSecret>
			<p:watermark id="passwordlWatermark" for="password" value="#{messages['login.form.password']}" />
			
			<h:outputLabel rendered="#{request.getParameter('error')}" styleClass="alert alert-error">#{messages['login.form.invalid.credentials']}</h:outputLabel>
			<h:commandButton id="submit" action="#{loginBackingBean.login()}" value="#{messages['login.form.sumbit.button']}" styleClass="btn btn-large btn-primary"/>
		</h:form>
	</ui:define>
</ui:composition>